<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        window.onload=function(){
            var a=document.getElementsByTagName("input");
            a[4].onclick=function(){
                var b=Number(a[0].value);
                var c=Number(a[1].value);
                var d=Number(a[2].value);
                var s=(b+c+d)/2;
                if((b+c)>d && (b+d)>c && (c+d)>b){
                    a[3].value=Math.sqrt(s*(s-b)*(s-c)*(s-d));
                }else{
                    a[3].value="不能构成三角形";
                    
                }
            }
            a[5].onclick=function(){
                a[0].value="";
                a[1].value="";
                a[2].value="";
                a[3].value="";
            }
        }
    </script>
</head>
<body>
    <input type="text" placeholder="请输入第一条边">
    <input type="text" placeholder="请输入第二条边">
    <input type="text" placeholder="请输入第三条边">
    <input type="text" placeholder="三角形的结果或面积">
    <input type="button" value="确定">
    <input type="button" value="重置">
</body>
</html>